//
//  ViewController.m
//  11201
//
//  Created by student on 16/3/3.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()<UITableViewDataSource,UITableViewDelegate>
@property (weak, nonatomic) IBOutlet UITableView *tableView;


@property (nonatomic,strong) NSArray *dataArr;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    
    self.dataArr = @[@"吃饭",@"刷牙",@"洗澡",@"刷牙",@"洗澡",@"吃饭",@"刷牙",@"洗澡",@"吃饭",@"刷牙",@"洗澡",@"吃饭",@"刷牙",@"洗澡",@"吃饭",@"刷牙",@"洗澡",@"吃饭",@"刷牙",@"洗澡"];
    
}
-(UITableView *)setUpTableView{
    UITableView *tableView = [[UITableView alloc] init];
    [tableView setFrame:[UIScreen mainScreen].bounds];
    return tableView;
}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.dataArr.count;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cell"];
    cell.textLabel.text = self.dataArr[indexPath.row];
    cell.imageView.image = [UIImage imageNamed:@"star"];
    cell.imageView.highlightedImage = [UIImage imageNamed:@"star2"];
    
    return cell;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
